package com.solution.admin.order.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.solution.admin.order.dao.OrderPayDao;
import com.solution.admin.order.entity.OrderPayEntity;
import com.solution.admin.order.service.OrderPayService;

import com.solution.common.dao.BaseDao;
import com.solution.common.page.PageBean;
import com.solution.common.page.PageParam;
import com.solution.common.service.impl.BaseServiceImpl;
import com.solution.common.utils.string.StringUtil;

/**
 * 订单付款service实现层
 * @author lilp
 * @date 2017-09-18 19:24:13
 */
@Service
public class OrderPayServiceImpl extends BaseServiceImpl<OrderPayEntity> implements OrderPayService {

	/**
	 * 订单付款接口
	 */
	@Autowired
	private OrderPayDao orderPayDao;

	protected BaseDao<OrderPayEntity> getDao() {
		return this.orderPayDao;
	}

	/**
	 * 保存订单付款
	 * @param orderPayEntity 订单付款实体
	 * @return Long 添加成功订单付款的ID
	 * @author lilp
	 * @date 2017-09-18 19:24:13
	 */
	public long saveOrderPay(OrderPayEntity orderPayEntity) {
		return orderPayDao.saveOrderPay(orderPayEntity);
	}

	/**
	 * 分页查询订单付款
	 * @param pageParam 分页参数
	 * @param paramMap 查询参数
	 * @return PageBean 分页参数和分页数据
	 * @author lilp
	 * @date 2017-09-18 19:24:13
	 */
	@Override
	public PageBean listOrderPayPage(PageParam pageParam, Map<String, Object> paramMap) {
		return orderPayDao.listOrderPayPage(pageParam, paramMap);
	}
	
	/**
	 * 根据ID查询用户信息
	 * @param id 用户id
	 * @return orderPayEntity 用户对象
	 * @author lilp
	 * @date 2017-09-18 19:24:13
	 */
	public OrderPayEntity getOrderPayById(Long id) {
		return orderPayDao.getById(id.longValue());
	}

	/**
	 * 更新用户
	 * @param orderPayEntity 用户实体
	 * @return Long 更新是否成功，>1代表更新成功
	 * @author lilp
	 * @date 2017-09-18 19:24:13
	 */
	@Override
	public int updateOrderPay(OrderPayEntity orderPayEntity) {
		return orderPayDao.updateOrderPay(orderPayEntity);
	}
	
	
	/**
	 * 根据条件查询订单付款
	 * @param param
	 * @return 数据列表
	 * @author lilp
	 * @date 2017-09-18 19:24:13
	 */
	@Override
	public List<OrderPayEntity> listOrderPay( Map<String, Object> param){
		return  orderPayDao.listOrderPay(param);
	}
	
	/**
	 * 删除订单付款
	 * @param 
	 * @return int 返回删除记录条数
	 * @author lilp
	 * @date 2017-09-18 19:24:13
	 */
	public int deleteOrderPayById(long id){
		return  orderPayDao.deleteById(id);
	}
	
}
